package com.lliane.LlianeJPFFT;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

public class LlianeJPFFT extends Activity {
    /** Called when the activity is first created. */
	public static ProgressDialog pb_dialog;
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	
    	pb_dialog = new ProgressDialog(this);
		pb_dialog.setTitle("FFT Tables Generation");
		pb_dialog.setMessage("Processing Fast Fourier Transform (FFT)");
		pb_dialog.setMax(71);
		pb_dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);		
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        imgv = (ImageView) findViewById(R.id.draw);
        Button go = (Button) findViewById(R.id.go);        
        go.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v){
				pb_dialog.show();
				try {
					o = openFileOutput("KanjiListHiragana.java", Context.MODE_WORLD_WRITEABLE);
				} catch (FileNotFoundException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				/*new Thread (new Runnable() {
					public void run() {*/
						LlianeFFT.gen("KanjiListHiragana", "kl", KanjiML.hiragana);
					/*}
				}).start();*/
				pb_dialog.dismiss();
				
			}
		});
        
        
    }
    public static ImageView imgv;
    public static Bitmap bmp;
    public static FileOutputStream o;
}